package manage.commons;

import java.io.File;

/**
 * 常量
 * 
 * @author dongji
 * 
 */
public final class Constants {

	private Constants() {
	}

	public static final String OPEREATE_INSERT = "insert";
	public static final String OPEREATE_UPDATE = "update";
	public static final String OPEREATE_DELETE = "delete";
	public static final String RETURN_SUCCESS = "success";
	public static final String RETURN_NO_CHANGE = "nochange";
	public static final String RETURN_FAILED = "failed";
	public static final String RETURN_EXISTS = "exists";
	public static final String RETURN_NOT_EXISTS = "notexists";
	public static final String DEFAULT_ENCODE = "utf-8";

	public static final String SEPARATE = File.separator;

	public static final String MAILSENDER = "admin@163.com";

	// 总监
	public final static int DIRECTOR = 4;
	// 部门经理
	public final static int MANAGER = 3;
	// 组长
	public final static int LEADER = 2;
	// 普通员工
	public final static int WORKER = 1;

	public static final String ENCRYPT_KEY = "D%@Z*#_L"; // 加密密钥
	// super manager key
	public static final String SUPERMANAGER_KEY = "s";
	// super manager value
	public static final String SUPERMANAGER = "s^&5ly*)_234zuyr#d$";

	public static final String LOGIN_PAGE = "/login.jsp";
	public static final String INDEX_PAGE = "/main.jsp";
	public static final String INDEX_ACTION = "/index.do";
	// 未授权显示页面
	public static final String UN_AUTHOR_PAGE = "/global/un-authorized.jsp";

	// 未授权action路径
	public static final String UN_AUTHOR = "unauthorized";

	// 员工权限key
	public static final String WORKER_RBAC_PREFIX = "worker_rbac_";

	// rbac key
	public static final String RBAC = "rbac_key";

	public static final String RBAC_MA_PRIFX = "menu_action_";
	public static final String RBAC_MAR_PRIFX = "menu_action_range_";
	public static final String WORKER_ROLE_PRIFX = "w_r_";
	public static final String ALL_RBAC = "all_rbac";

	public static final String ROLEMENUFOLDERS = "roleMenuFolders";
	public static final String MENUFOLDERS = "menuFolders";

	/**
	 * 当前登录workerId在session的键名
	 */
	public static final String SESSION_CURRENT_WORKER = "currentWorker";

	/**
	 * 当前登录workerId在session的键名
	 */
	public static final String SESSION_CURRENT_WORKER_ID = "currentWorkerId";

	/**
	 * 当前登录时间在session的键名
	 */
	public static final String SESSION_LOGIN_TIME = "loginTime";
	/**
	 * 当前登录IP在session的键名
	 */
	public static final String SESSION_LOGIN_IP = "loginIp";
	/**
	 * 当前session的创建时间
	 */
	public static final String SESSION_CREATE_TIME = "createTime";
	
	/**
	 * 当前用户的worker在cookie的键名
	 */
	public static final String COOKIE_U = "u";

	/**
	 * 当前用户的workerId在cookie的键名
	 */
	public static final String COOKIE_WORKER_ID = "cookie_currentWorkerId";
	/**
	 * 当前用户的loginTime在cookie的键名
	 */
	public static final String COOKIE_LOGIN_TIME = "cookie_loginTime";

	public static final String PASSWORD_COOKIE_ENCRYPT = "fd@zio#gdf%8dj9f^05l*4gdf";

	/** 缓存中验证码的key **/
	public static final String COOKIE_CAPTCHA_KEY = "captcha";
}
